{% macro thread_list(threads, forum=None) -%}
  <ol class="threads">
  {% for thread in threads.object_list %}
    {% if forum %}
      {% set _forum = forum %}
    {% else %}
      {% set _forum = thread.forum %}
    {% endif %}
    <li class="cf">
      <div class="type">
        {% if thread.is_locked %}
          <img src="{{ STATIC_URL }}sumo/img/blank.png" alt="{{ pgettext('thread_type', 'Locked') }}" title="{{ pgettext('thread_type', 'Locked') }}" class="icon-locked" />
        {% endif %}
        {% if thread.is_sticky %}
          <img src="{{ STATIC_URL }}sumo/img/blank.png" alt="{{ pgettext('thread_type', 'Sticky') }}" title="{{ pgettext('thread_type', 'Sticky') }}" class="icon-sticky" />
        {% endif %}
      </div>
      <div class="title"><a href="{{ url('forums.posts', forum_slug=_forum.slug, thread_id=thread.id)|urlparams(last=thread.last_post.id) }}">{{ thread.title }}</a></div>
      <div class="author"><a class="username" href="{{ profile_url(thread.creator) }}">{{ display_name(thread.creator) }}</a></div>
      <div class="replies">{{ thread.replies }}</div>
      {% if thread.last_post %}
        <div class="last-post">
          <a href="{{ thread.get_last_post_url() }}">
            {{ datetimeformat(thread.last_post.created) }}
          </a><br/>
          {{ _('by <a class="username" href="{profile_url}">{username}</a>')|fe(profile_url=profile_url(thread.last_post.author), username=display_name(thread.last_post.author)) }}
        </div>
      {% endif %}
    </li>
  {% endfor %}
  </ol>
  {{ threads|paginator }}
{%- endmacro %}
